<?php
$this->breadcrumbs=array(
	'Customers'=>array('index'),
	'Manage',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('customer-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<?php echo Yii::app()->bootstrap->register();?>
<h1>Management Customer</h1>
<hr/>  
 
<?php 
$this->beginWidget('zii.widgets.CPortlet', array());
$this->widget('bootstrap.widgets.TbMenu', array(
        'type'=>'pills',
        'items'=>array(
                array('label'=>'Create', 'icon'=>'icon-plus', 'url'=>Yii::app()->controller->createUrl('create'),'active'=>true, 'linkOptions'=>array()),
                array('label'=>'List', 'icon'=>'book', 'url'=>Yii::app()->controller->createUrl('list'), 'linkOptions'=>array()),
                array('label'=>'Admin', 'icon'=>'user', 'url'=>Yii::app()->controller->createUrl('admin'), 'linkOptions'=>array()),
        ),
));
$this->endWidget();
?>
<hr/> 
<!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'customer-grid',
	'dataProvider'=>$model->search(),
        'type'=>'bordered condesed',
	'template'=>'{items}{pager}',
        //'itemsCssClass'=>'striped bordered condensed',
	//'filter'=>$model,
	'columns'=>array(
		//'idCustomer',
		'nombre',
		'correo',
		//'Vendor_idVendor',
                'rif',
		array(
                        'class'=>'bootstrap.widgets.TbButtonColumn',
			'template' => '{view}{update}{delete}',
			'buttons' => array(
			      'view' => array(
					'label'=> 'View',
					'options'=>array(
						'class'=>'btn btn-small view'
					)
				),	
                              'update' => array(
					'label'=> 'Modificar',
					'options'=>array(
						'class'=>'btn btn-small update'
					)
				),
				'delete' => array(
					'label'=> 'Delete',
					'options'=>array(
						'class'=>'btn btn-small delete'
					)
				)
                            ),
                                'htmlOptions'=>array('style'=>'width: 130px'),
                        ),
	),
)); ?>

<br>
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div>
